summaryrefslogtreecommitdiffstats
path: root/glucometerutils/drivers/fslibre.py
blob: 823e49cdb14c16f4563e9d3fc623ce71114544ee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# -*- coding: utf-8 -*-
#
# SPDX-FileCopyrightText: © 2017 The glucometerutils Authors
# SPDX-License-Identifier: MIT
"""Driver for FreeStyle Libre devices.

Supported features:
    - get readings (sensor, flash and blood glucose), including comments;
    - get and set date and time;
    - get serial number and software version;
    - get and set patient name;
    - memory reset (caution!)

Expected device path: /dev/hidraw9 or similar HID device. Optional when using
HIDAPI.

Further information on the device protocol can be found at

https://protocols.glucometers.tech/abbott/freestyle-libre

"""

from typing import Optional

from glucometerutils.support import freestyle_libre


class Device(freestyle_libre.LibreDevice):
    _MODEL_NAME = "FreeStyle Libre"

    def __init__(self, device_path: Optional[str]) -> None:
        super().__init__(0x3650, device_path, encoding="utf-8")